//
//  MyCollectionViewCell.m
//  19-TheHomeOfCar
//
//  Created by Snow on 16/8/9.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "MyCollectionViewCell.h"

@implementation MyCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _image = [[UIImageView alloc] init];
        _label = [[UILabel alloc] init];
        [self.contentView addSubview:_image];
        [self.contentView addSubview:_label];
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    _image.frame = CGRectMake(5, 5, self.contentView.frame.size.width - 10, self.contentView.frame.size.height / 3 * 2 - 10);
    _label.frame = CGRectMake(5, self.contentView.frame.size.height / 3 * 2 + 10, self.contentView.frame.size.width - 10, self.contentView.frame.size.height / 3 - 10);
}
@end
